﻿@model PasswordResetViewModel
@{
    ViewBag.Title = ViewBag.ForgotPassword ? "Reset Password" : "Set Password";
    ViewBag.SmPageColumns = GalleryConstants.ColumnsAuthenticationSm;
    ViewBag.MdPageColumns = GalleryConstants.ColumnsAuthenticationMd;
}

<section role="main" class="container main-container page-reset-password">
    <div class="row">
        <div class="col-sm-12">
            <h1 class="text-center">@ViewBag.Title</h1>
        </div>
    </div>

    <div class="row">
        <div class="@ViewHelpers.GetColumnClasses(ViewBag)">
            @if (ViewData.ModelState[""] != null && ViewData.ModelState[""].Errors.Count > 0)
            {
                @ViewHelpers.AlertDanger(
                    @<text>@Html.ValidationMessage("")</text>
                );
            }

            @if (ViewBag.ForgotPassword)
            {
                <p class="text-center">
                    We are sorry to hear you forgot your NuGet.org account password. You can reset the NuGet.org account password using the form below.
                </p>
            }
            else
            {
                <p class="text-center">
                    You can set a NuGet.org account password using the form below.
                </p>
            }

            <div class="reset-form">
                @using (Html.BeginForm())
                {
                    @Html.AntiForgeryToken()

                    <div class="form-group @Html.HasErrorFor(m => m.NewPassword)">
                        @Html.ShowLabelFor(m => m.NewPassword)
                        @Html.ShowPasswordFor(m => m.NewPassword)
                        @Html.ShowValidationMessagesFor(m => m.NewPassword)
                    </div>
                    <div class="form-group @Html.HasErrorFor(m => m.ConfirmPassword)">
                        @Html.ShowLabelFor(m => m.ConfirmPassword)
                        @Html.ShowPasswordFor(m => m.ConfirmPassword)
                        @Html.ShowValidationMessagesFor(m => m.ConfirmPassword)
                    </div>

                    <div class="form-group">
                        <input type="submit" class="btn btn-primary form-control" value="Send" />
                    </div>
                }
            </div>
        </div>
    </div>
</section>